package br.ufpe.cin.rdfilter.model;

import java.io.Serializable;
import javax.persistence.*;


/**
 * The persistent class for the feedback database table.
 * 
 */
@Entity
@Table(name="feedback")
@NamedQueries({
	@NamedQuery(name = "Feedback.findAll", query = "SELECT f FROM Feedback f"),
	@NamedQuery(name = "Feedback.findAnnotation", query = "SELECT f FROM Feedback f WHERE f.userBean = ?1"),
	@NamedQuery(name = "Feedback.findExp", query = "SELECT f FROM Feedback f WHERE f.userBean = ?1 " +
													"AND (f.type = \'True Positive\' OR f.type = \'False Negative\')"),
	@NamedQuery(name = "Feedback.findNonExp", query = "SELECT f FROM Feedback f WHERE f.userBean = ?1 " +
													"AND f.type = \'False Positive\'"),
	@NamedQuery(name = "Feedback.findByQuery", query = "SELECT f FROM Feedback f WHERE f.queryBean = ?1 ")
})
public class Feedback implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="id_feedback_seq", sequenceName="id_feedback_seq", allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_feedback_seq")
	@Column(unique=true, nullable=false)
	private Integer id;

	@Column(length=2147483647)
	private String term;

	@Column(length=2147483647)
	private String type;

	//bi-directional many-to-one association to Query
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="query")
	private Query queryBean;

	//bi-directional many-to-one association to User
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="\"user\"")
	private User userBean;

	public Feedback() {
	}

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getTerm() {
		return this.term;
	}

	public void setTerm(String term) {
		this.term = term;
	}

	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Query getQueryBean() {
		return this.queryBean;
	}

	public void setQueryBean(Query queryBean) {
		this.queryBean = queryBean;
	}

	public User getUserBean() {
		return this.userBean;
	}

	public void setUserBean(User userBean) {
		this.userBean = userBean;
	}

}